/* Copyright (c) 2014, Google Inc. Please see the AUTHORS file for details. */
/* All rights reserved.  Use of this source code is governed by a BSD-style */
/* license that can be found in the LICENSE file. */

@import url("../common/spark_widget.css");

:host {
  display: inline-block;
  position: relative;
  width: 70px;
  height: 30px;
  overflow: hidden;
  border: 1px solid #b6b6b6;
  border-radius: 3px;
  box-shadow: inset 0px 0px 1px 0 rgba(0,0,0,0.1);
  -webkit-user-select: none;
  -moz-user-select: none;
  -webkit-transition: border 0.130s ease-out;
  transition: border 0.130s ease-out;
  cursor: pointer;
}

:host(.on) {
  border: 1px solid #4584f2;
}

#toggle {
  position: absolute;
  left: -42px;
  width: 112px;
  height: 100%;
  overflow: hidden;
  white-space: nowrap;
  -webkit-transition: left 0.130s ease-out;
  transition: left 0.130s ease-out;
}

#toggle.dragging {
  -webkit-transition: all 0;
  transition: all 0;
}

#toggle.on {
  left: 0;
}

#toggle > * {
  float: left;
}

#onLabel, #offLabel {
  width: 50%;
  height: 100%;
  line-height: 30px;
  text-align: center;
  font-size: 10px;
}

#onLabel {
  padding-right: 14px;
  background-color: #488afd;
  color: white;
}

#offLabel {
  padding-left: 14px;
  background-color: #bfbfbf;
  color: #716f6f;
}

#thumb {
  position: absolute;
  left: 42px;
  width: 28px;
  height: 100%;
  border-radius: 2px;
  background-color: white;
}

#thumb::after {
  content: "";
  position: absolute;
  display: block;
  top: 10px;
  left: 11px;
  height: 10px;
  width: 8px;
  background-image: -webkit-linear-gradient(left, #d4d3d3 40%, transparent 40%);
  background-image: -moz-linear-gradient(left, #d4d3d3 40%, transparent 40%);
  background-image: -ms-linear-gradient(left, #d4d3d3 40%, transparent 40%);
  background-size: 4px;
}
